//
//  GRClassManageVC.m
//  test
//
//  Created by 朱圳 on 2018/3/16.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "GRClassManageVC.h"
#import "StuRefuseVC.h"
#import "StuSureVC.h"
#import "WaitStudentSureVC.h"
#import "GRNotClassVC.h"
#import "GRHandleCoureseVC.h"

@interface GRClassManageVC ()<UITableViewDelegate,UITableViewDataSource>
@property(strong,nonatomic)NSArray*list;
@property(nonatomic,strong)UITableView *tableView;

@end

@implementation GRClassManageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.list = @[@"待处理",@"未上课",@"等待学生确认",@"学生已确认",@"学生已拒绝"];
    self.title = @"上课管理";
    [self.view addSubview:self.tableView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return self.list.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *SimpleTableIdentifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SimpleTableIdentifier];
    if (cell ==nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier: SimpleTableIdentifier];
        cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
        
    }
    cell.textLabel.text = self.list[indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    switch (indexPath.row) {
        case 0:
            {
                GRHandleCoureseVC *vc = [[GRHandleCoureseVC alloc]init];
                vc.title = self.list[indexPath.row];
                [self.navigationController pushViewController:vc animated:YES];
            }
            break;
        case 1:
        {
            GRNotClassVC *vc = [[GRNotClassVC alloc]init];
            vc.title = self.list[indexPath.row];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 2:
        {
            WaitStudentSureVC *vc = [[WaitStudentSureVC alloc]init];
            vc.title = self.list[indexPath.row];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 3:
        {
            StuSureVC *vc = [[StuSureVC alloc]init];
            vc.title = self.list[indexPath.row];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 4:
        {
            StuRefuseVC *vc = [[StuRefuseVC alloc]init];
            vc.title = self.list[indexPath.row];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
            
        default:
            break;
    }
}
-(UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.backgroundColor = [UIColor whiteColor];
        _tableView.tableFooterView = [[UIView alloc]init];
        _tableView.delegate = self;
        _tableView.dataSource = self;
    }
    return _tableView;
}
@end


